home *** CD-ROM | disk | FTP | other *** search
/ Computer Select (Limited Edition) / Computer Select.iso / pcmag / v10n16 / atsay next >
Encoding:
Text File  |  1991-08-26  |  1.3 KB  |  38 lines

  1. * FUNCTION atsay
  2. *
  3. * Use HP LJ vertical and horizontal decipoint positioning to place
  4. * character or numeric output on a page.
  5. *
  6. * Requires PUBLIC variables pitch and lpi.
  7. *
  8. ***********************************************************************
  9. FUNCTION atsay
  10. PARAMETERS mrow, mcol, fieldval, pictval
  11.  
  12. move_hor = ROUND(720/pitch, 2)       && Relative horizontal move value
  13. hor = 720/pitch * mcol               && Horizontal position based on @ SAY value
  14. ver = LTRIM(STR(720/lpi * mrow, 5, 2)) && Vertical position based on @ SAY value
  15.  
  16. IF TYPE("pictval") = "C"               && "L" if not provided
  17.    fieldval = TRANSFORM(fieldval, pictval)   && Transform the number
  18.    no_chars = LEN(fieldval)            && Calculate length of field
  19.    ??? CHR(27) + "&a" + LTRIM(STR(hor,5,2)) + "h" + ver + "V"
  20.    *
  21.    * Calculate rightmost character position
  22.    *
  23.    end_hor = hor + (move_hor * no_chars)
  24.    *
  25.    * Calculate leftmost character position allowing 90% of pitch value
  26.    * for each character
  27.    new_pos = end_hor - (move_hor * no_chars * .9)
  28.    FOR char = 1 TO no_chars
  29.       ??? CHR(27) + "&a" + LTRIM(STR(new_pos,5,2)) + "H" + 
  30. SUBSTR(fieldval,char,1)
  31.       new_pos = new_pos + (move_hor * .9)   && Calculate next character position
  32.    ENDFOR
  33. ELSE
  34.    ??? CHR(27) + "&a" + LTRIM(STR(hor,5,2)) + "h" +  ver + "V" + fieldval
  35. ENDIF
  36. RETURN ""
  37.  
  38.